package cn.wangzengqiang.study.designpattern.singleton;

/**
 * 内部类单例 推荐使用
 */
public class InnerClassSingleton {
    private InnerClassSingleton() {
    }

    private static class InnerClassSingletonHolder {
        private static InnerClassSingleton instance = new InnerClassSingleton();
    }

    public static InnerClassSingleton getInstance() {
        return InnerClassSingletonHolder.instance;
    }
}
